
package com.mephi.util;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Set;

/**
 *
 * @author mephisto
 */
public interface Compression
{

    /**
    * @param directory
    * @param compressedFile
    * @return list of decompressed files or empty list if archive couldn't be decompressed
    * @throws IOException
    */
    public List<File> decompressFile(File directory, File compressedFile) throws IOException;

    /**
    *
    * @param file to be compressed
    * @param compressedFile path where will be created a file
    * @throws IOException
    */
    public void compressFile(File file, File compressedFile) throws IOException;

    /**
    *
    * @param files to be compressed
    * @param compressedFile path where will be created a file
    * @throws IOException
    */
    public void compressFiles(Set<File> files, File compressedFile) throws IOException;

    /**
    *
    * @param inStream to be compressed
    * @param streamName the name of stream to set
    * @param compressedFile path where will be created a file
    * @throws IOException
    */
    public void compressStream(InputStream inStream, String streamName, File compressedFile) throws IOException;
}